home *** CD-ROM | disk | FTP | other *** search
- # Copyright (c) 1994,1995 Jason L. Haar
- # Copyright (c) 1994,1995 Lazerjem Ltd.
- # All rights reserved.
- #
- # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- # SUCH DAMAGE.
- #
- # @(#)00README.linux 1.0 (Lazerjem) 17/Jul/94
- # 23/Feb/95
- # 2/Apr/95
- # 14/Dec/95
-
- This is a binary release of sendmail-8.7.3 for Linux. I think this
- package should give you a _total_ MTA environment - from sendmail down
- to local delivery agents mail.local and (by popular demand!) procmail
- (v3.11pre3) [thanks to Stephen R. van den Berg for the package, and
- allowing me to include the binaries here].
-
- This was compiled under Linux 1.2.13; gcc-2.5.8/libc-4.5.26.
-
- Sendmail can be compiled for use on a NIS network - but I didn't need that
- so it isn't here :-) Also, I used the New Berkeley DB database instead of
- the older 'dbm' format 'cause it's better. I've also included mail.local and
- my procmail binary distribution - a bigger package overall, but procmail is
- soooo good, I feel it should be shared by all :-)
-
- I have put together an install script 'install_sendmail' which isn't
- intended to be run blindly. Edit it to match your situation (BUT KEEP
- READING THIS FILE FIRST!).
-
- Below is an introductory article to sendmail I've written that may be of
- help to those just getting into the area. Don't forget - for any real detail
- - Read The Manual! I've included a copy of the Sendmail Operation Manual in
- this distribution (PostScript and Text form [the latter looks OK to me in an
- xterm and console - anything else I can't guarantee]). It's a bit of a
- jumble of information - some only appropriate for those wanting to compile
- the package themselves - and some which everyone should read/know.
-
- Something else I wrote (file Internet-Mail) may be of help to real
- beginners. It covers the DNS (you can't run mail on the Internet without
- knowledge of this) as well as Internet mail itself.
-
- Any comments to me at:
-
- Jason Haar <j.haar@lazerjem.demon.co.uk>
-
- Sendmail V8
- -----------
-
- Sendmail-V8 (latest release 8.7.3) is written by Eric Allman, and is
- considered the official release of sendmail. Most vendors base their own
- sendmail on this release, but they usually screw up somewhere ;-). If you
- are managing a network of Unix boxes of differing vendors, I'd STRONGLY
- suggest that you throw out all the vendor-specific sendmail and install
- sendmail-V8 instead. Configuration format for sendmail is specific to each
- vendor, thus you will save yourself a lot of work by learning one sendmail
- really well instead of several poorly.
-
- Usenet News is the best place to get help from about sendmail. The
- newsgroups comp.mail.sendmail (and friends) are read by the authors of
- the major Email packages, and provide good advice, as well as
- announcements of bug fixes and security holes.
-
- ** NOTE ** Unless you have a problem compiling sendmail, NONE of the
- Linux newsgroups/mailing-lists are appropriate for such questions -
- let's try to lower the amount of traffic on those groups by ensuring
- our enquiries go to the right places. There's nothing special about
- Linux now - it's just another Un*x :-)
-
- IDA vs Sendmail V8
- -------------------
-
- Which is best? Sendmail V8 :-)
-
- The current version of 8.7.3 contains support for more new features than
- IDA, such as MIME support and 8-bit traffic. These are standards-based,
- unlike similar features in the current version of IDA. Also, the mere fact
- that it is newer means that there are more bug fixes, including several
- security bugs that still affect most other versions.
-
- If you are interested in compiling your own version from scratch, the
- official anonymous ftp site for sendmail-8.7.3 is:
-
- <URL:ftp://ftp.cs.berkeley.edu:/ucb/src/sendmail/sendmail.8.7.3.tar.gz>
-
- The latest release (as at 2nd Oct 1995) is 8.7.3. This package amounts to
- over 900Kbytes (tar.gz), and includes full documentation on sendmail. By
- that I mean FULL. O'Reilly & Associates have recently published a Nutshell
- Handbook on sendmail (covers both V8 and IDA - really good), but the docs in
- this distribution would be more than enough for anyone to really get into
- the nitty-gritty of sendmail.
-
- Anyway, if you decide on sendmail-V8, get the latest version. 8.7.3
- compiles and runs fine under Linux - you could just type "makesendmail".
- BTW, I also grabbed the db-1.85 package so that I could use the
- reverse-alias features of sendmail (my binaries use db instead of dbm for
- this too).
-
- [NOTE to sendmail-8.6 users: FLOCK is still broken under Linux - but under
- 8.7 that is known - you don't need to set HASFLOCK to 0 anymore - it already
- is :-) ]
-
-
- Don't forget to ALWAYS copy out of the way any existing files you have, just
- in case you want to go back to an older release.
-
- The 'install_sendmail' script contains information on file-protections that
- I use - they're about as scrict as you can put them. The "getloadav" feature
- of sendmail normally needs sendmail to be setgid to kmem, but Linux's /proc
- file system removes the need for that :-)
-
- Sendmail can be used in one of two ways.
-
- 1) Started from /etc/rc.* (default). This means sendmail is running
- continually. Invoked as:
-
- /usr/lib/sendmail -bd -q1h
-
- The "-bd" option tells sendmail it is running as a permanent daemon,
- and the "-q1h" tells it that Email messages that weren't deliverable
- the first time are to be re-tried at 1 hour intervals. If you
- are on a SLIP/PPP link, even 1 hour may be too often - you
- could take it out altogether and manaully run the queue during
- the first moments of bringing up your PPP/SLIP link (via
- 'sendmail -q').
-
- 2) Started from /etc/inetd.conf. This means sendmail is only running
- when there is an incoming SMTP connection, but this actually is
- heavier on the system due to the overheads at initial startup. The
- advantage of this method is that you can use tcp_wrapper on it, so
- that you can configure just who can make SMTP connections to you.
-
- Invoked as:
-
- /usr/lib/sendmail -bs
-
- The "-bs" means run as a SMTP connection, that exits after it
- finishes. You can't use the "-q" option here, so this must be
- done manually by creating a cron job to run at regular
- intervals (doesn't need to be as root unless you're using the
- "restrictqrun" option).
-
- Sendmail reads the file /etc/sendmail.cf at startup, and logs everything via
- syslog. If you have problems with sendmail, see what /var/log/syslog tells
- you (assuming that's where your syslog messages for mail goes to).
-
- Sendmail is very difficult to configure. The secret to success with sendmail
- is to configure it as little as possible. You should take some time (days to
- weeks) to decide just what you want sendmail to do for you. A lot of sites
- end up with extremely ugly- looking sendmail configurations because they
- didn't plan in advance, and then are forced to "patch it up" as time goes
- by.
-
- Both sendmail-8.7.3 and sendmail-IDA use the m4 preprocessor to manipulate
- their config files. My own config file for sendmail is 14 lines long, yet m4
- produces a 600+ line file out of that which sendmail actually uses. This
- preprocessor design greatly simplifies the creation and management of
- sendmail config files. Not only are they more human-readable, but global
- configuration bugs and re-writes can be corrected very quickly and
- seamlessly with patches.
-
- Sendmail-8.7.3 comes with several example configurations that you can look
- over for help (in cf/cf). My own config is called lazerjem.mc. You simply
- run m4 on these ".mc" files to create ".cf" files that sendmail would
- actually use.
-
- E.g
-
- m4 lazerjem.mc > sendmail.cf
-
-
- *** PLEASE!!!! Don't use any of these without editing!!! ***
-
- Some Configuration Options
- --------------------------
-
- I won't go into too much detail here as they are all covered in the
- documentation and README file in the "cf" directory. However, I will comment
- on a few that I think are important/interesting.
-
- *** FEATURE(always_add_domain)
-
- I _always_ configure mailers to _always_ write the fully qualified domain
- name after every address - even local ones (e.g.
- "jason@lazerjem.demon.co.uk" instead of "jason@lazerjem" or even "jason").
-
- My reason for this is to ensure that the people using Email always know what
- their "true" Email address is - not just a limited part of it. There have
- been so many times I've talked to people who didn't know what their own
- Email address was, because their site hadn't configured their MTAs to fully
- expand all addresses.
-
- *** define(`confUSERDB_SPEC', `/etc/userdb.db')dnl
-
- This allows you to perform "reverse aliasing" on outgoing messages. The
- "/etc/aliases" file allows you to define strings which map to usercodes;
- well the reverse-alias file allows you to map usercodes onto strings! That
- way you can have all your Email going out as "j.haar@lazerjem.demon.co.uk"
- instead of "jason@lazerjem.demon.co.uk" (where "jason" is the usercode).
- This requires the New Berkeley DB format - none of the others will do. I'd
- suggest compiling sendmail with this database format as it supposedly
- operates faster/more efficiently than any of the others anyway - as well as
- allowing you to share the database files over different architectures -
- something no other database format can do. You can get this database package
- from:
-
- <URL:ftp://ftp.cs.berkeley.edu:/ucb/4bsd/db.1.85.tar.Z>
-
-
- *** FEATURE(local_procmail)
-
- This tells sendmail to configure itself to use procmail as it's local mailer
- instead of <whatever>. However, I like using the "-t" option to procmail
- which says that if procmail fails to deal with a message (say, due to
- diskspace problems, or a bad .procmailrc file), then it will tell sendmail
- to REQUEUE to message instead of BOUNCING it. So in lazerjem.mc you will see
- I override the default values of PROCMAIL_MAILER_ARGS and LOCAL_MAILER_ARGS
- - adding "-t".
-
- *** define(`LUSER_RELAY', procmail:/etc/procmailrcs/lusers)dnl
-
- This is a feature much asked after for dialup sites. LUSER is the action to
- do when a message comes in for a local address that doesn't exist. Normally
- such messages are bounced "No such user" - this option allows such messages
- to instead be accepted and delivered to the routine mentioned. In the cf/cf
- directory, you will find my /etc/procmailrcs/lusers file - very
- sophisticated ;-)
-
- *** define(`SMART_HOST', smtp:host.domain)
-
- This is to be used if you are allowed to redirect all your non-local
- mailer to a smarter mail hub. Good for PPP/SLIP sites. Check with your
- Network Provider to see if they'd mind you doing that - it saves you
- having to hang around waiting for connections to succeed/fail.
-
- NOTE: That reminds me. Don't forget that EVERY SMTP site/machine *must
- always* accept Email for "postmaster@machine_name". This alias usually
- points to the person who is responsible for Email on that system - probably
- you! So *make sure* there is an entry for postmaster in your /etc/aliases
- file; mine looks like this:
-
- #/etc/aliases
- #----- BEGIN FILE -------
-
- postmaster: jason
- mailer-daemon: postmaster
- root: postmaster
- j.haar: jason
- jason.haar: jason
-
- Don't forget that aliases aren't case-sensitive - "PostMASter" is the same
- as "postmaster".
-
- For reverse-aliases, your file appears as follows:
-
- #/etc/userdb
- #--- BEGIN FILE ---
-
- jason:mailname J.Haar@lazerjem.demon.co.uk
-
- #--- END FILE ---
-
- Then you run makemap on it to produce the DB file sendmail actually
- uses.
-
- makemap btree /etc/userdb.db < /etc/userdb
-
- I actually wrote a wee script to replace 'newaliases' so that both
- aliases and reverse-aliases files were updated simultaneously when
- it's run.
-
- What options do I need?
- -----------------------
-
- This is why sendmail is so difficult to configure. A site may need a
- gateway into UUCP, fax software, X400, as well as SMTP. All these
- require their own special calls/rewrites, and it all adds up into one
- big mess. The m4 preprocessor goes some way towards simplifying all
- this by allowing mail managers to produce macros which "plug into"
- their existing sendmail configurations. Two such examples are the
- Usenet and Fax gateways (the hooks, not the software ;-) that are
- included in the base sendmail distribution - I personally use the fax
- gateway with FlexFAX (a freely available fax package). If you decide
- to use them, you just have to add one or two lines to your sendmail
- ".mc" file, and re-create your config. I personally like the new
- sendmail as it is possible to remove all UUCP-related code with one
- line ("FEATURE(nouucp)") - I have no need for any of that.
-
- I will just cover what I feel are the three most likely configurations
- for sendmail hosts. Anything more complicated than this will require
- more options than I can possibly cover - so Read The Fine Manual! :-)
-
- 1) These days a lot of networked machines having some form of direct
- Internet access, so it is relatively easy to come up with sendmail
- configurations for these. Most will probably just want local mail to
- be handled by the local mailer, and all the rest to be dealt with by
- the DNS/SMTP pair. The file tcpproto.mc does this job for you.
- Actually, my file lazerjem.mc will also do the trick - the only
- change being that you don't need the SMART_HOST option (that's
- basically the only difference between a SLIP/PPP site and a
- fully-connected site).
-
-
- 2) You may have a nice cluster of Linux workstations which NFS mount
- their /var/spool/mail partition from a central hub. As you don't
- want these workstations to handle incoming mail themselves, you can
- put a minimal config file on them that simply directs all mail that
- they send to the hub to deal with. Don't forget that these machines
- won't need a sendmail daemon running on them (only needed for
- incoming - not outgoing), so save a little memory and remove it from
- the appropriate /etc/rc* file (although you may need a queuing run
- [sendmail -q] to run on occasion from cron for the case when the hub
- is down). For this setup, just use clientproto.mc
-
- NOTE: Running mail over NFS is potentially pretty rotten - you have
- to be VERY careful about file locking. Ensure you're running lockd
- or statd on the server, and YOU REALLY SHOULD use procmail as you're
- local delivery agent - it is very good at handling file locking -
- even over NFS.
-
-
- 3) Dial-up Internet connections. That means SLIP or PPP. I just use the
- 'nodns' option. Under 8.7.3, that actually stops sendmail bothering
- to ask the DNS for anything. So if you send a mail message to
- yourself, or to anything mentioned in your /etc/hosts file, then
- sendmail will do it without bothering to ask the DNS (in the past it
- would always do a DNS lookup - even for local deliveries.).
- I use dial-on-demand PPP, and with sendmail-8.7.3 everything is
- perfect. If mail is sent locally - it just gets delivered, but if
- a message is sent to an unknown host, then sendmail tries to connect
- to the SMART_HOST - which starts the dial-on-demand PPP link. I also
- have ppp configured to force a sendmail queue run (sendmail -q)
- whenever the link goes up (via /etc/ppp/ip-up).
-
-
- Packages mentioned:
- ------------------
-
- sendmail ftp://ftp.cs.berkeley.edu/ucb/src/sendmail/sendmail.8.7.3.tar.gz
-
- procmail ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail.tar.gz
-
- db ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz
-
-
- As usual - _please_ use archie to find a closer site to you than
- these.
-